using System;
using System.Collections.Generic;
using System.Text;

using PickGold;
using PickGold.Database;

namespace PickGold.Entities.Table
{
	public class CBaseReplyInfo : CBaseTable
    {
        //
        public const string ENTITY_NAME = "tb_sys_reply_info";
        public const string ENTITY_ALIAS = "replies";

		public const string ENTITY_KEY = "reply_id";
		public const string ENTITY_SYMBOL = "reply_name";
		
		public const string NEWS_ID = CBaseNewsInfo.ENTITY_KEY;
		public const string USER_ID = CBaseUserInfo.ENTITY_KEY;
		public const string ITEM_VALUE = "item_value";
		public const string ITEM_CREATE = "item_create";
		//
        private SBaseReplyInfo _ = null;
        //
        public CBaseReplyInfo() : base(ENTITY_NAME, ENTITY_ALIAS) { }
        public CBaseReplyInfo(CDatabase db) : base(db, ENTITY_NAME, ENTITY_ALIAS) { }
        public CBaseReplyInfo(string alias) : base(ENTITY_NAME, alias) { }
        public CBaseReplyInfo(CDatabase db, string alias) : base(db, ENTITY_NAME, alias) { }
        //
        protected override void SetSchema()
        {
            this.SetSchema(new SBaseReplyInfo());
        }
        protected void SetSchema(SBaseReplyInfo s)
        {
            this._ = s;
            base.SetSchema(s);
        }
		//
		protected override void PreInitSchema()
		{
			base.PreInitSchema();
			this._DataTable.Columns.Add(NEWS_ID, typeof(long)).DefaultValue = this._.NewsID;
			this._DataTable.Columns.Add(USER_ID, typeof(long)).DefaultValue = this._.UserID;
			this._DataTable.Columns.Add(ITEM_VALUE, typeof(string)).MaxLength = 8000;
			this._DataTable.Columns.Add(ITEM_CREATE, typeof(DateTime)).DefaultValue = this._.ItemCreate;
		}
		//
		#region Property
		//
		public long NewsID
		{
			set
			{
				this._.NewsID = value;
				this.SetValue(NEWS_ID, value);
			}
			get
			{
				return this._.NewsID;
			}
		}
		//
		public long UserID
		{
			set
			{
				this._.UserID = value;
				this.SetValue(USER_ID, value);
			}
			get
			{
				return this._.UserID;
			}
		}
		//
		public string ItemValue
		{
			set
			{
				this._.ItemValue = value;
				this.SetValue(ITEM_VALUE, value);
			}
			get
			{
				return this._.ItemValue;
			}
		}
		//
		public DateTime ItemCreate
		{
			set
			{
				this._.ItemCreate = value;
				this.SetValue(ITEM_CREATE, value);
			}
			get
			{
				return this._.ItemCreate;
			}
		}
		//
		#endregion
		//
		public override bool MoveTo(int position)
		{
			if (!base.MoveTo(position))
				return false;
			this._.NewsID = this.GetValue<long>(NEWS_ID);
			this._.UserID = this.GetValue<long>(USER_ID);
			this._.ItemValue = this.GetValue<string>(ITEM_VALUE);
			this._.ItemCreate = this.GetValue<DateTime>(ITEM_CREATE);
			return true;
		}
		//
    }
    //
	public class SBaseReplyInfo : SBaseTable
    {
		public long NewsID = -1;
		public long UserID = -1;
		public string ItemValue = null;
		public DateTime ItemCreate = DateTime.MinValue;
	}
    //
}
//
